import fetch from '@/utils/fetch';

export function login(userName, password) {
	return fetch({
		url :  '/auth',
		method : 'post',
		data : {
			userName ,
			password
		}
	});
}

export function getInfo(token) {
	return fetch({
		url :  '/user',
		method : 'get'
	});
}

export function getMenu(token) {
	return fetch({
		url :  '/sys/menu/viewMenu',
		method : 'get'
	});
}

export function logout() {
	return fetch({
		url :  '/auth/destroy',
		method : 'put'
	});
}